<template>
  <div class="card">
    <div class="img">
      <img :src="props.option.coverImgUrl" alt="" />
      <div class="mark">
        <img src="../../../../../../assets/耳机.svg" />
        <span class="val"
          >{{ Math.round(props.option.playCount / 10000) }}万</span
        >
      </div>
    </div>

    <div class="text">
      <!-- <div class="tit"></div> -->
      <span class="title">{{ props.option.name }}</span>
      <span class="auth">{{ props.option.creator.nickname }}</span>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  name: "PlayCard",
});
</script>
<script lang="ts" setup>
const props = defineProps(["option"]);
</script>

<style lang="scss" scoped>
.card {
  width: 140px;
  height: 190px;
  background: white;
  // border-radius: 30px;
  box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
  transition: 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
}

.img {
  width: 140px;
  height: 140px;
  position: relative;

  img {
    width: 140px;
    height: 140px;
  }

  .mark {
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);

    img {
      margin-left: 6px;
      width: 12px;
      height: 12px;
    }

    .val {
      margin-left: 6px;
      font-size: 10px;
      font-family: "黑体";
      color: #c6c6c6;
    }
  }
  // border-top-left-radius: 30px;
  // border-top-right-radius: 30px;
  // background: linear-gradient(#e66465, #9198e5);
  // display: flex;
  // align-items: top;
  // justify-content: right;
}

.save {
  transition: 0.2s ease-in-out;
  border-radius: 10px;
  margin: 20px;
  width: 30px;
  height: 30px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text {
  // margin: 20px;
  display: flex;
  flex-direction: column;
  align-items: space-around;
}

.save .svg {
  transition: 0.2s ease-in-out;
  width: 15px;
  height: 15px;
}

.icon-box {
  margin-top: 15px;
  width: 70%;
  padding: 10px;
  background-color: #e3fff9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: left;
}

.icon-box svg {
  width: 17px;
}

.text .h3 {
  font-family: "Lucida Sans" sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: black;
}

.text .p {
  font-family: "Lucida Sans" sans-serif;
  color: #999999;
  font-size: 13px;
}

.icon-box .span {
  margin-left: 10px;
  font-family: "Lucida Sans" sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #9198e5;
}

.card:hover {
  cursor: pointer;
  box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);
}

.save:hover {
  transform: scale(1.1) rotate(10deg);
}

.save:hover .svg {
  fill: #ced8de;
}

.text {
  padding: 6px;
  display: flex;
  flex-direction: column;

  .title {
    width: 100%;
    font-size: 12px;
    font-family: "黑体";
    overflow: hidden;
    text-overflow: ellipsis; //文本溢出显示省略号
    white-space: nowrap; //文本不会换行
  }

  .auth {
    margin-top: 10px;
    font-size: 11px;
    font-family: "黑体";
    overflow: hidden;
    text-overflow: ellipsis; //文本溢出显示省略号
    white-space: nowrap; //文本不会换行
  }
}
</style>
